function varargout = stageTWOgui(varargin)
% STAGETWOGUI MATLAB code for stageTWOgui.fig
%      STAGETWOGUI, by itself, creates a new STAGETWOGUI or raises the existing
%      singleton*.
%
%      H = STAGETWOGUI returns the handle to a new STAGETWOGUI or the handle to
%      the existing singleton*.
%
%      STAGETWOGUI('CALLBACK',hObject,eventData,handles,...) calls the local
%      function named CALLBACK in STAGETWOGUI.M with the given input arguments.
%
%      STAGETWOGUI('Property','Value',...) creates a new STAGETWOGUI or raises the
%      existing singleton*.  Starting from the left, property value pairs are
%      applied to the GUI before stageTWOgui_OpeningFcn gets called.  An
%      unrecognized property name or invalid value makes property application
%      stop.  All inputs are passed to stageTWOgui_OpeningFcn via varargin.
%
%      *See GUI Options on GUIDE's Tools menu.  Choose "GUI allows only one
%      instance to run (singleton)".
%
% See also: GUIDE, GUIDATA, GUIHANDLES

% Edit the above text to modify the response to help stageTWOgui

% Last Modified by GUIDE v2.5 06-Nov-2013 14:01:12

% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name',       mfilename, ...
                   'gui_Singleton',  gui_Singleton, ...
                   'gui_OpeningFcn', @stageTWOgui_OpeningFcn, ...
                   'gui_OutputFcn',  @stageTWOgui_OutputFcn, ...
                   'gui_LayoutFcn',  [] , ...
                   'gui_Callback',   []);
if nargin && ischar(varargin{1})
    gui_State.gui_Callback = str2func(varargin{1});
end

if nargout
    [varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
else
    gui_mainfcn(gui_State, varargin{:});
end
% End initialization code - DO NOT EDIT


% --- Executes just before stageTWOgui is made visible.
function stageTWOgui_OpeningFcn(hObject, eventdata, handles, varargin)
% This function has no output args, see OutputFcn.
% hObject    handle to figure
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
% varargin   command line arguments to stageTWOgui (see VARARGIN)

% Choose default command line output for stageTWOgui
handles.output = hObject;

% Update handles structure
guidata(hObject, handles);

% UIWAIT makes stageTWOgui wait for user response (see UIRESUME)
% uiwait(handles.figure1);


% --- Outputs from this function are returned to the command line.
function varargout = stageTWOgui_OutputFcn(hObject, eventdata, handles) 
% varargout  cell array for returning output args (see VARARGOUT);
% hObject    handle to figure
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Get default command line output from handles structure
varargout{1} = handles.output;


% --- Executes on selection change in list_remainingZeros.
function list_remainingZeros_Callback(hObject, eventdata, handles)
% hObject    handle to list_remainingZeros (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Hints: contents = cellstr(get(hObject,'String')) returns list_remainingZeros contents as cell array
%        contents{get(hObject,'Value')} returns selected item from list_remainingZeros


% --- Executes during object creation, after setting all properties.
function list_remainingZeros_CreateFcn(hObject, eventdata, handles)
% hObject    handle to list_remainingZeros (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called

% Hint: listbox controls usually have a white background on Windows.
%       See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end


% --- Executes on selection change in list_remainingPoles.
function list_remainingPoles_Callback(hObject, eventdata, handles)
% hObject    handle to list_remainingPoles (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Hints: contents = cellstr(get(hObject,'String')) returns list_remainingPoles contents as cell array
%        contents{get(hObject,'Value')} returns selected item from list_remainingPoles


% --- Executes during object creation, after setting all properties.
function list_remainingPoles_CreateFcn(hObject, eventdata, handles)
% hObject    handle to list_remainingPoles (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called

% Hint: listbox controls usually have a white background on Windows.
%       See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end


% --- Executes on selection change in list_actualZeros.
function list_actualZeros_Callback(hObject, eventdata, handles)
% hObject    handle to list_actualZeros (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Hints: contents = cellstr(get(hObject,'String')) returns list_actualZeros contents as cell array
%        contents{get(hObject,'Value')} returns selected item from list_actualZeros


% --- Executes during object creation, after setting all properties.
function list_actualZeros_CreateFcn(hObject, eventdata, handles)
% hObject    handle to list_actualZeros (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called

% Hint: listbox controls usually have a white background on Windows.
%       See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end


% --- Executes on selection change in list_actualPoles.
function list_actualPoles_Callback(hObject, eventdata, handles)
% hObject    handle to list_actualPoles (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Hints: contents = cellstr(get(hObject,'String')) returns list_actualPoles contents as cell array
%        contents{get(hObject,'Value')} returns selected item from list_actualPoles


% --- Executes during object creation, after setting all properties.
function list_actualPoles_CreateFcn(hObject, eventdata, handles)
% hObject    handle to list_actualPoles (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called

% Hint: listbox controls usually have a white background on Windows.
%       See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end


% --- Executes on button press in btn_addPole.
function btn_addPole_Callback(hObject, eventdata, handles)
% hObject    handle to btn_addPole (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)


% --- Executes on button press in btn_removePole.
function btn_removePole_Callback(hObject, eventdata, handles)
% hObject    handle to btn_removePole (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)


% --- Executes on button press in btn_create.
function btn_create_Callback(hObject, eventdata, handles)
% hObject    handle to btn_create (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)


% --- Executes on button press in btn_plotAll.
function btn_plotAll_Callback(hObject, eventdata, handles)
% hObject    handle to btn_plotAll (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)


% --- Executes on button press in btn_plotStage.
function btn_plotStage_Callback(hObject, eventdata, handles)
% hObject    handle to btn_plotStage (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)


% --- Executes on button press in btn_save.
function btn_save_Callback(hObject, eventdata, handles)
% hObject    handle to btn_save (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)


% --- Executes on selection change in list_stages.
function list_stages_Callback(hObject, eventdata, handles)
% hObject    handle to list_stages (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Hints: contents = cellstr(get(hObject,'String')) returns list_stages contents as cell array
%        contents{get(hObject,'Value')} returns selected item from list_stages


% --- Executes during object creation, after setting all properties.
function list_stages_CreateFcn(hObject, eventdata, handles)
% hObject    handle to list_stages (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called

% Hint: listbox controls usually have a white background on Windows.
%       See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end


% --- Executes on button press in btn_auto.
function btn_auto_Callback(hObject, eventdata, handles)
% hObject    handle to btn_auto (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)


% --- Executes on button press in btn_create.
function pushbutton9_Callback(hObject, eventdata, handles)
% hObject    handle to btn_create (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)


% --- Executes on button press in btn_addZero.
function btn_addZero_Callback(hObject, eventdata, handles)
% hObject    handle to btn_addZero (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)


% --- Executes on button press in btn_removeZero.
function btn_removeZero_Callback(hObject, eventdata, handles)
% hObject    handle to btn_removeZero (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)


% --- Executes on button press in btn_stageUp.
function btn_stageUp_Callback(hObject, eventdata, handles)
% hObject    handle to btn_stageUp (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)


% --- Executes on button press in btn_stageDown.
function btn_stageDown_Callback(hObject, eventdata, handles)
% hObject    handle to btn_stageDown (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)


% --- Executes on button press in btn_zoom.
function btn_zoom_Callback(hObject, eventdata, handles)
% hObject    handle to btn_zoom (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)


% --- Executes on button press in btn_pan.
function btn_pan_Callback(hObject, eventdata, handles)
% hObject    handle to btn_pan (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)


% --- Executes on button press in btn_grid.
function btn_grid_Callback(hObject, eventdata, handles)
% hObject    handle to btn_grid (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)



function txt_gain_Callback(hObject, eventdata, handles)
% hObject    handle to txt_gain (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Hints: get(hObject,'String') returns contents of txt_gain as text
%        str2double(get(hObject,'String')) returns contents of txt_gain as a double


% --- Executes during object creation, after setting all properties.
function txt_gain_CreateFcn(hObject, eventdata, handles)
% hObject    handle to txt_gain (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called

% Hint: edit controls usually have a white background on Windows.
%       See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end


% --- Executes on button press in btn_modGain.
function btn_modGain_Callback(hObject, eventdata, handles)
% hObject    handle to btn_modGain (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)



function edit2_Callback(hObject, eventdata, handles)
% hObject    handle to edit2 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Hints: get(hObject,'String') returns contents of edit2 as text
%        str2double(get(hObject,'String')) returns contents of edit2 as a double


% --- Executes during object creation, after setting all properties.
function edit2_CreateFcn(hObject, eventdata, handles)
% hObject    handle to edit2 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called

% Hint: edit controls usually have a white background on Windows.
%       See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end


% --- Executes on button press in btn_minRD.
function btn_minRD_Callback(hObject, eventdata, handles)
% hObject    handle to btn_minRD (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)


% --- Executes on button press in btn_track.
function btn_track_Callback(hObject, eventdata, handles)
% hObject    handle to btn_track (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
